<?php

class Default_Form_Login extends Zend_Form {
    public function init(){
        $this->setName('loginForm');
        $username = new Zend_Form_Element_Text('username');
        $username->setLabel('Username')->setRequired(true)
            ->addValidator('NotEmpty')->addFilter('StripTags')
            ->setAttrib('required','required')
            ->removeDecorator('HtmlTag')->removeDecorator('Label');

        $password = new Zend_Form_Element_Password('password');
        $password->setLabel('Password')->setRequired(true)
            ->addValidator('NotEmpty')->addFilter('StripTags')
            ->setAttrib('required','required')
            ->removeDecorator('HtmlTag')->removeDecorator('Label');

        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setLabel('Login')
            ->removeDecorator('HtmlTag')->removeDecorator('Label');
        
        $this->setDecorators(array(
                               array('viewScript',
                               array('viewScript'=>'template/form_login.phtml'),
                        )));  
                        
        $this->addElements(array($username,$password,$submit));
    }
}